<template>
  <view :style="themeColor">
    <view class="page">
      <view
        class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex feedBack_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-stretch justify-between feedBack_fd0_0'>
          <view class='flex flex-wrap align-center feedBack_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  feedBack_fd0_0_c0_c0'>&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='feedBack_fd0_0_c1_c0'>意见反馈</text>
          </view>
          <view class='flex align-center justify-end feedBack_fd0_0_c2'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---意见反馈表单flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-direction align-stretch feedBack_fd1_0'>
          <text class='feedBack_fd1_0_c0'>您有什么意见建议</text>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <view class='flex flex-wrap feedBack_fd1_0_c1_c0'>
              <textarea class='flex feedBack_input_fd1_0_c1_c0' confirm-type="done" :placeholder="'提出您的意见建议，帮助我们更好地改进'"
                :maxlength="300" placeholder-style="color:#999;font-size:28rpx" v-model="body" />

            </view>
          </view>
          <view class='flex flex-direction flex-wrap align-stretch'>
            <benben-images-upload ref="benbenImagesUploadfd1_0_c2_c0" :img-list.sync="img" :img-ids.sync="img_id"
              :maxlength="6">
              <template #content="{ num, maxlength, isShow, imgList }">
                <view class="flex flex-wrap align-start flex feedBack_fd1_0_c2_c0">

                  <view v-for="(image, index) in imgList" :key="index"
                    class='flex position-relative feedBack_fd1_0_c2_c00'>
                    <text class='fu-iconfont2 position-absolute feedBack_fd1_0_c2_c000'
                      @tap.stop="$refs.benbenImagesUploadfd1_0_c2_c0.delImage(index)">&#xE8E7;</text>
                    <image class='feedBack_fd1_0_c2_c001'
                      @tap.stop="$refs.benbenImagesUploadfd1_0_c2_c0.previewImage(index)" mode="aspectFill" :src='image'>
                    </image>
                  </view>

                  <image class='feedBack_fd1_0_c2_c01' @tap.stop="$refs.benbenImagesUploadfd1_0_c2_c0.manyChooseImage()"
                    v-if="isShow" mode="aspectFit" :src='STATIC_URL+"64.png"'></image>

                </view>
              </template>
            </benben-images-upload>
          </view>
          <view class='flex flex-wrap align-center feedBack_fd1_0_c3'>
          </view>
          <text class='feedBack_fd1_0_c4'>请留下您的联系方式</text>
          <input class='feedBack_fd1_0_c5' type="number" :placeholder="`请输入手机号`" confirm-type="done" :maxlength="11"
            placeholder-style="color:#999;font-size:28rpx" v-model="tel" />
        </view>
        <button class='flex-sub feedBack_fd1_1' @tap.stop="postfeedbackFunc()">提交</button>
      </view>

      <!---意见反馈表单flex布局结束-->


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "changeId": "1",
        "changeType": [{
          "name": "下载/加载问题",
          "value": "1",
          "image": ""
        }, {
          "name": "会员付费问题",
          "value": "2",
          "image": ""
        }, {
          "name": "章节/图片问题",
          "value": "3",
          "image": ""
        }, {
          "name": "APP体验问题",
          "value": "4",
          "image": ""
        }, {
          "name": "卡顿/不流畅",
          "value": "5",
          "image": ""
        }, {
          "name": "其他",
          "value": "6",
          "image": ""
        }],
        "dataList": [],
        "body": "",
        "img": [],
        "img_id": "",
        "submit": {
          "ces1": ""
        },
        "tel": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //提交反馈
      async postfeedbackFunc() {
        if (!validate(this.body, 'require')) {
          this.$message.info('内容不能为空');
          return false;
        }
        if (!validate(this.tel, 'require')) {
          this.$message.info('请输入问题描述');
          return false;
        }
        //请求方法
        //数据验证

        let datasubmit = await this.$api.dbPost(global.apiUrls.post5cc3f28296cf0, {
          body: this.body,
          thumb: this.img,
          contact:this.tel
        });
        if (!datasubmit) return
        if (datasubmit.data.code != 1) {
          this.$message.info(datasubmit.data.msg);
          return
        }
        let infosubmit = datasubmit.data;
        this.submit = infosubmit.data
        this.$message.info('提交成功');
        setTimeout(() => {
          this.$urouter.navigateBack(1);
        }, 800)
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(246, 247, 249, 1);
    background-size: 100% auto;
  }

  .feedBack_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .feedBack_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 200rpx;
  }

  .feedBack_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
    line-height: 50rpx;
  }

  .feedBack_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .feedBack_fd0_0_c0 {
    width: 200rpx;
  }

  .feedBack_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .feedBack_fd1_1 {
    background: #E63838;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    height: 88rpx;
    line-height: 88rpx;
    width: 702rpx;
    position: fixed;
    left: 24rpx;
    bottom: calc(40rpx + var(--window-bottom));
  }

  .feedBack_fd1_0_c5 {
    margin: 0rpx 0rpx 32rpx 24rpx;
  }

  .feedBack_fd1_0_c4 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    margin: 0rpx 0rpx 24rpx 24rpx;
  }

  .feedBack_fd1_0_c3 {
    background: #F8F8F8;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    width: 750rpx;
    height: 16rpx;
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  .feedBack_fd1_0_c2_c01 {
    width: 172rpx;
    height: 172rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c2_c001 {
    width: 172rpx;
    height: 172rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .feedBack_fd1_0_c2_c000 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .feedBack_fd1_0_c2_c00 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .feedBack_fd1_0_c2_c0 {
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .feedBack_input_fd1_0_c1_c0 {
    width: 100%;
    height: 166rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: var(--benbenFontColor0);
  }

  .feedBack_fd1_0_c1_c0 {
    width: 686rpx;
    border-radius: 10rpx 10rpx 10rpx 10rpx;
    margin: 0rpx 0rpx 0rpx 24rpx;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .feedBack_fd1_0_c0 {
    font-size: 32rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
    margin: 32rpx 24rpx 24rpx 24rpx;
  }

  .feedBack_fd1_0 {
    background: var(--benbenbgColor1);
    background-size: 100% auto !important;
  }
</style>
